class Student {
    public String name;
    public int age;
    public static String classRoom = "计算机2班";

    /* public Student(String name,int age){
         this.name = name;
         this.age = age;
         System.out.println("带有2个参数的构造方法！");
     }*/
    public Student() {
        System.out.println("不带参数的构造方法！");
    }

    {
        System.out.println("非静态代码块/实例代码块/构造代码块！->初始化非静态的数据成员");
    }

    static {
        System.out.println("静态代码块->初始化静态的数据成员/提前准备一些数据");
    }

   /* {
        name = "lisi";
        age = 29;
        System.out.println("非静态代码块/实例代码块/构造代码块！ ——>初始化非静态的数据成员");
    }*/

   /* public static int getSize() {
        return size;
    }

    public static void setSize(int size) {
        Student.size = size;
    }*/

  /*  public static String getClassRoom() {
        return classRoom;
    }

    public static void setClassRoom(String classRoom) {
        Student.classRoom = classRoom;
    }*/

    public void doClass(){
        System.out.println("上课！");
    }
}

public class Test2 {
    public static void main(String[] args) {
       Student student1 = new Student();
        // Student student = new Student("zhangsan",20);
//        System.out.println(student1.name );

    }
   /* public static void main7(String[] args) {
       Student.func();
    }*/
  /*  public static void main6(String[] args) {
        Student student = new Student("zhangsan",20);
        System.out.println(Student.getSize());
    }*/
  /* public static void mainStaticFunc(){

    }*/
   /* public static void main3(String[] args) {
        Test2.mainStaticFunc();
        mainStaticFunc();
        Student.func();
   }

    public static void main4(String[] args) {
        Student.func();//调用静态成员方法
        System.out.println(Student.classRoom );
    }
*/



  /*  public static void main(String[] args) {
       Student.setClassRoom("计算机3班");
        System.out.println(Student.getClassRoom() );
        Student student1 = new Student("zhangsan",20);
        Student student2 = new Student("lisi",16);
        Student student3 = new Student("wangwu",15);
        System.out.println(student1.classRoom);
        System.out.println(student2.classRoom);
        System.out.println(student3.classRoom);
    }*/
}
